home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / CIncludes / PCCard.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  25.2 KB  |  658 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        PCCard.h
  3.  
  4.      Contains:    PC Card Family Programming interface
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1996-1998 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __PCCARD__
  18. #define __PCCARD__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23. #ifndef __NAMEREGISTRY__
  24. #include <NameRegistry.h>
  25. #endif
  26.  
  27.  
  28.  
  29. #if PRAGMA_ONCE
  30. #pragma once
  31. #endif
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. #if PRAGMA_IMPORT
  38. #pragma import on
  39. #endif
  40.  
  41. #if PRAGMA_STRUCT_ALIGN
  42.     #pragma options align=power
  43. #elif PRAGMA_STRUCT_PACKPUSH
  44.     #pragma pack(push, 2)
  45. #elif PRAGMA_STRUCT_PACK
  46.     #pragma pack(2)
  47. #endif
  48.  
  49.  
  50. enum {
  51.     kServiceCategoryPCCard        = FOUR_CHAR_CODE('pccd')
  52. };
  53.  
  54.  
  55. typedef UInt32                             PCCardEvent;
  56. typedef UInt32                             PCCardEventMask;
  57. typedef UInt32                             PCCardClientID;
  58. typedef UInt32                             PCCardTimerID;
  59. typedef UInt32                             PCCardSocket;
  60. typedef UInt32                             PCCardWindowID;
  61. typedef UInt32                             PCCardWindowType;
  62. typedef UInt32                             PCCardWindowSize;
  63. typedef UInt32                             PCCardWindowOffset;
  64. typedef UInt32                             PCCardWindowAlign;
  65. typedef OptionBits                         PCCardWindowState;
  66. typedef UInt32                             PCCardAccessSpeed;
  67. typedef UInt32                             PCCardWindowParam;
  68. typedef UInt32                             PCCardPage;
  69. typedef UInt32                             PCCardVoltage;
  70. /*
  71.     Several of the client notification bit flags have been REMOVED since the first
  72.     release of this header.  These were unused codes that were either
  73.     copied directly from PC Card 2.x, or from the PCMCIA standard.  In all cases,
  74.     they were completely unimplemented and would never be sent under PCCard 3.0.
  75.     
  76.     The removed flags are:
  77.         kPCCardClientInfoMessage, kPCCardSSUpdatedMessage,
  78.         and kPCCardFunctionInterruptMessage.
  79.     
  80.     If your software used any of these flags, you should delete any references
  81.     to them.  These event codes are being recycled for new features.
  82. */
  83. /* Client notification bit flags */
  84.  
  85. enum {
  86.     kPCCardNullMessage            = 0x00000000,                    /* no messages pending (not sent to clients)*/
  87.     kPCCardInsertionMessage        = 0x00000001,                    /* card has been inserted into the socket*/
  88.     kPCCardRemovalMessage        = 0x00000002,                    /* card has been removed from the socket- do not touch hardware!*/
  89.                                                                 /* Lock and Unlock may be used for a hardware locking card-cage. */
  90.     kPCCardLockMessage            = 0x00000004,                    /* card is locked into the socket with a mechanical latch */
  91.     kPCCardUnlockMessage        = 0x00000008,                    /* card is no longer locked into the socket */
  92.                                                                 /* Ready and Reset are holdovers from PC Card 2.x, but someone might be using them (!?) */
  93.     kPCCardReadyMessage            = 0x00000010,                    /* card is ready to be accessed -- do not use! this event is never sent! (use kPCCardInsertion instead) */
  94.     kPCCardResetMessage            = 0x00000020,                    /* physical reset has completed -- do not use! this event is never sent! (use kPCCardResetComplete instead) */
  95.                                                                 /* InsertionRequest and InsertionComplete may be used with certain cages (??) */
  96.     kPCCardInsertionRequestMessage = 0x00000040,                /* request to insert a card using insertion motor */
  97.     kPCCardInsertionCompleteMessage = 0x00000080,                /* insertion motor has finished inserting a card */
  98.     kPCCardEjectionRequestMessage = 0x00000100,                    /* user or other client is requesting a card ejection*/
  99.     kPCCardEjectionCompleteMessage = 0x00000200,                /* card ejection succeeded- do not touch hardware! */
  100.     kPCCardEjectionFailedMessage = 0x00000400,                    /* eject failure due to electrical/mechanical problems*/
  101.     kPCCardPMResumeMessage        = 0x00000800,                    /* power management resume */
  102.     kPCCardPMSuspendMessage        = 0x00001000,                    /* power management suspend */
  103.     kPCCardPMSuspendRequest        = 0x00002000,                    /* power management sleep request */
  104.     kPCCardPMSuspendRevoke        = 0x00004000,                    /* power management sleep revoke */
  105.     kPCCardResetPhysicalMessage    = 0x00008000,                    /* physical reset is about to occur on this card -- this event is never sent! */
  106.     kPCCardResetRequestMessage    = 0x00010000,                    /* physical reset has been requested by a client*/
  107.     kPCCardResetCompleteMessage    = 0x00020000,                    /* ResetCard() background reset has completed*/
  108.     kPCCardBatteryDeadMessage    = 0x00040000,                    /* battery is no longer useable, data will be lost*/
  109.     kPCCardBatteryLowMessage    = 0x00080000,                    /* battery is weak and should be replaced*/
  110.     kPCCardWriteProtectMessage    = 0x00100000,                    /* card is now write protected*/
  111.     kPCCardWriteEnabledMessage    = 0x00200000,                    /* card is now write enabled*/
  112.     kPCCardUnexpectedRemovalMessage = 0x02000000,                /* card has unexpectedly been manually ejected -- careful, this event occurs at hardware interrupt time */
  113.                                                                 /* Unconfigured is a (currently unused) holdover from PC Card 2.x */
  114.     kPCCardUnconfiguredMessage    = 0x04000000,                    /* a CARD_READY was delivered to all clients and no client */
  115.                                                                 /*    requested a configuration for the socket -- this event is never sent under PCCard 3.0! */
  116.     kPCCardStatusChangedMessage    = 0x08000000,                    /* status change for cards in I/O mode*/
  117.     kPCCardTimerExpiredMessage    = 0x10000000,                    /* message sent when requested time has expired */
  118.     kPCCardRequestAttentionMessage = 0x20000000,
  119.     kPCCardEraseCompleteMessage    = 0x40000000,
  120.     kPCCardRegistrationCompleteMessage = (long)0x80000000,        /* notifications available only in PCCard 3.1 and later */
  121.     kPCCardPMEnabledMessage        = 0x00800000                    /* power management has been enabled by the user; if appropriate, clients should call PCCardSetPowerLevel(off) */
  122. };
  123.  
  124. typedef OptionBits                         PCCardWindowAttributes;
  125. /*    window state (values of PCCardWindowAttributes) */
  126.  
  127. enum {
  128.     kWSCommon                    = 0x0001,                        /* common memory window */
  129.     kWSAttribute                = 0x0002,                        /* attribute memory window*/
  130.     kWSIO                        = 0x0004,                        /* I/O window*/
  131.     kWSCardBus                    = 0x0800,                        /* CardBus bridge window */
  132.     kWSTypeMask                    = 0x0807,                        /* window type mask*/
  133.     kWSEnabled                    = 0x0008,                        /* window enabled*/
  134.     kWS8bit                        = 0x0010,                        /* 8-bit data width window*/
  135.     kWS16bit                    = 0x0020,                        /* 16-bit data width window*/
  136.     kWS32bit                    = 0x0040,                        /* 32-bit data width window*/
  137.     kWSAutoSize                    = 0x0080,                        /* auto-size data width window*/
  138.     kWSWidthMask                = 0x00F0,                        /* window data width mask*/
  139.     kWSProtected                = 0x0100,                        /* window write protected*/
  140.     kWSPrefetchable                = 0x0200,                        /* bridge window prefetchable*/
  141.     kWSPageShared                = 0x0400,                        /* page register is shared*/
  142.     kWSWindowSizeOffset            = 0x4000,
  143.     kWSChangeAccessSpeed        = 0x8000                        /* Used by CSModifyWindow only */
  144. };
  145.  
  146. /* window speed (sample values of PCCardAccessSpeed) for use in PCCardRequestWindow  */
  147.  
  148. enum {
  149.     kAccessSpeed600ns            = 0x006A,
  150.     kAccessSpeed500ns            = 0x005A,
  151.     kAccessSpeed400ns            = 0x004A,
  152.     kAccessSpeed300ns            = 0x003A,
  153.     kAccessSpeed250ns            = 0x0001,
  154.     kAccessSpeed200ns            = 0x0002,
  155.     kAccessSpeed150ns            = 0x0003,
  156.     kAccessSpeed100ns            = 0x0004
  157. };
  158.  
  159. typedef UInt32                             PCCardInterfaceType;
  160. /* InterfaceType bit-mask (values of PCCardInterfaceType) */
  161.  
  162. enum {
  163.     kIFTypeMask                    = 0x03,                            /* IO & memory type mask*/
  164.     kIFCardBus                    = 0x00,                            /* if bits 0 & 1 are zero then cardbus interface*/
  165.     kIFMemory                    = 0x01,                            /* if bit 0 set memory IF*/
  166.     kIFIO                        = 0x02,                            /* if bit 1 set IO IF*/
  167.     kIFReserved                    = 0x03,                            /* bits 0 and 1 set is reserved */
  168.     kIFDMA                        = 0x08,                            /* if bit 3 set DMA supported*/
  169.     kIFVSKey                    = 0x10,                            /* if bit 4 set supports low Voltage key*/
  170.     kIF33VCC                    = 0x20,                            /* if bit 5 set socket suports 3.3v*/
  171.     kIFXXVCC                    = 0x40,                            /* if bit 6 set socket supports X.X voltage*/
  172.     kIFYYVCC                    = 0x80                            /* if bit 7 set socket supports Y.Y voltage*/
  173. };
  174.  
  175. typedef UInt32                             PCCardCustomInterfaceID;
  176. /* Custom Interface Identifiers (values of PCCardCustomInterfaceID) */
  177.  
  178. enum {
  179.     kIFCustom_None                = 0x00,                            /* no custom interface ID */
  180.     kIFCustom_ZOOM                = 0x41                            /* ZOOM Video Mode custom interface identifier */
  181. };
  182.  
  183. typedef OptionBits                         PCCardConfigOptions;
  184. /* Bit mask values for PCCardConfigOptions in the configuration calls */
  185.  
  186. enum {
  187.     kEnableIRQSteering            = 0x0002,
  188.     kIRQChangeValid                = 0x0004,
  189.     kVppChangeValid                = 0x0010,
  190.     kEnableDMAChannel            = 0x0040,
  191.     kDMAChangeValid                = 0x0080,
  192.     kVSOverride                    = 0x0200                        /* Bits 10..31 reserved */
  193. };
  194.  
  195. /*
  196.    Configuration Registers Presence Mask for the FCR
  197.    Used by PCCardConfigPresentMask
  198. */
  199.  
  200. enum {
  201.     kConfigOptionPresent        = 0x00000001,
  202.     kConfigStatusPresent        = 0x00000002,
  203.     kPinReplacePresent            = 0x00000004,
  204.     kSocketCopyPresent            = 0x00000008,
  205.     kExtendedStatusPresent        = 0x00000010,
  206.     kIOBase0Present                = 0x00000020,
  207.     kIOBase1Present                = 0x00000040,
  208.     kIOBase2Present                = 0x00000080,
  209.     kIOBase3Present                = 0x00000100,
  210.     kIOLimitPresent                = 0x00000200
  211. };
  212.  
  213. typedef UInt32                             PCCardConfigPresentMask;
  214. typedef UInt32                             PCCardConfigRegisterIndex;
  215. typedef UInt32                             PCCardConfigRegisterOffset;
  216.  
  217. struct PCCardFunctionConfigReg {
  218.     Byte                             configOptionReg;
  219.     Byte                             configStatusReg;
  220.     Byte                             pinReplaceReg;
  221.     Byte                             socketCopyReg;
  222.     Byte                             extendedStatusReg;
  223.     Byte                             ioBase0;
  224.     Byte                             ioBase1;
  225.     Byte                             ioBase2;
  226.     Byte                             ioBase3;
  227.     Byte                             ioLimit;
  228. };
  229. typedef struct PCCardFunctionConfigReg    PCCardFunctionConfigReg;
  230.  
  231. typedef OptionBits                         PCCardSocketStatus;
  232. /*    general socket status bits (values of PCCardSocketStatus) */
  233.  
  234. enum {
  235.     kSTBatteryDead                = 0x0001,                        /* battery dead*/
  236.     kSTBatteryLow                = 0x0002,                        /* battery low*/
  237.     kSTBatteryGood                = 0x0004,                        /* battery good*/
  238.     kSTPower                    = 0x0008,                        /* power is applied*/
  239.     kST16bit                    = 0x0010,                        /* 16-bit PC Card present*/
  240.     kSTCardBus                    = 0x0020,                        /* CardBus PC Card present*/
  241.     kSTMemoryCard                = 0x0040,                        /* memory card present*/
  242.     kSTIOCard                    = 0x0080,                        /* I/O card present*/
  243.     kSTNotACard                    = 0x0100,                        /* unrecognizable PC Card detected*/
  244.     kSTReady                    = 0x0200,                        /* ready*/
  245.     kSTWriteProtect                = 0x0400,                        /* card is write-protected*/
  246.     kSTDataLost                    = 0x0800,                        /* data may have been lost due to card removal*/
  247.     kSTRingIndicate                = 0x1000,                        /* ring indicator is active*/
  248.     kSTReserved                    = 0xE000
  249. };
  250.  
  251. /* Bit mask for PCCardPowerOptions in the power management calls */
  252. typedef OptionBits                         PCCardPowerOptions;
  253.  
  254. enum {
  255.     kPCCardPowerOn                = 0x00000001,
  256.     kPCCardPowerOff                = 0x00000002,
  257.     kPCCardLowPower                = 0x00000004
  258. };
  259.  
  260. typedef OptionBits                         PCCardAdapterCapabilities;
  261. typedef UInt32                             PCCardAdapterPowerState;
  262. typedef OptionBits                         PCCardSCEvents;
  263. typedef UInt32                             PCCardWindow;
  264. typedef UInt32                             PCCardIRQ;
  265. typedef UInt32                             PCCardDMA;
  266. /* Selectors for PCCardGetGlobalOptions */
  267. /*    The type of the "value" parameter is provided for each selector. */
  268. typedef UInt32                             PCCardOptionSelector;
  269.  
  270. enum {
  271.     kPCCardPowerManagementAttrib = 1                            /* value = (Boolean*) enabled  */
  272. };
  273.  
  274.  
  275.  
  276. /* Types and structures for accessing the PCCard Assigned-Address property.*/
  277.  
  278. #define kPCCardAssignedAddressProperty "assigned-addresses"
  279.  
  280. enum {
  281.     kPCCardNonRelocatableSpace    = 0x80,
  282.     kPCCardPrefetchableSpace    = 0x40,
  283.     kPCCard16BitSpace            = 0x20,
  284.     kPCCardAddressTypeCodeMask    = 0x07,
  285.     kPCCardConfigSpace            = 0,
  286.     kPCCardIOSpace                = 1,
  287.     kPCCardMemorySpace            = 2,
  288.     kPCCardAttributeMemorySpace    = 4
  289. };
  290.  
  291. typedef UInt8                             PCCardAddressSpaceFlags;
  292.  
  293. enum {
  294.     kPCCardSocketNumberMask        = 0xF8,
  295.     kPCCardFunctionNumberMask    = 0x07
  296. };
  297.  
  298. typedef UInt8                             PCCardSocketFunction;
  299. typedef UInt8                             PCCardBusNumber;
  300. typedef UInt8                             PCCardRegisterNumber;
  301. /*
  302.    note: this structure is similar, but not the same as the PCIAssignedAddress structure
  303.          16-bit cards use this structure, CardBus cards use PCIAssignedAddress
  304. */
  305.  
  306. struct PCCardAssignedAddress {
  307.     PCCardAddressSpaceFlags         addressSpaceFlags;
  308.     UInt8                             reserved;
  309.     PCCardSocketFunction             socketFunctionNumber;
  310.     PCCardRegisterNumber             registerNumber;
  311.     UInt32                             address;
  312.     UInt32                             size;
  313. };
  314. typedef struct PCCardAssignedAddress    PCCardAssignedAddress;
  315. typedef PCCardAssignedAddress *            PCCardAssignedAddressPtr;
  316. #define GetPCCardIsNonRelocatable( AssignedAddressPtr )        ((AssignedAddressPtr)->addressSpaceFlags & kPCCardNonRelocatableSpace)
  317. #define GetPCCardIsPrefetchable( AssignedAddressPtr )        ((AssignedAddressPtr)->addressSpaceFlags & kPCCardPrefetchableSpace)
  318. #define GetPCCardIs16BitSpace( AssignedAddressPtr )            ((AssignedAddressPtr)->addressSpaceFlags & kPCCard16BitSpace)
  319. #define GetPCCardAddressSpaceType( AssignedAddressPtr )        ((AssignedAddressPtr)->addressSpaceFlags & kPCCardAddressTypeCodeMask)
  320. #define GetPCCardSocketNumber( AssignedAddressPtr )            (((AssignedAddressPtr)->socketFunctionNumber & kPCCardSocketNumberMask) >> 3)
  321. #define GetPCCardFunctionNumber( AssignedAddressPtr )        ((AssignedAddressPtr)->socketFunctionNumber & kPCCardFunctionNumberMask)
  322. #define GetPCCardRegisterNumber( AssignedAddressPtr )        ((AssignedAddressPtr)->registerNumber)
  323. /*----------------------------------------------------------------------
  324.     Client Support
  325. ----------------------------------------------------------------------*/
  326. /* Prototype for client callback */
  327. typedef CALLBACK_API_C( OSStatus , PCCardEventHandler )(PCCardEvent theEvent, PCCardSocket vSocket, UInt32 device, UInt32 info, UInt32 MTDRequest, UInt32 *Buffer, UInt32 misc, UInt32 status, void *clientParam);
  328. EXTERN_API_C( OSStatus )
  329. PCCardRegisterClient            (const RegEntryID *        deviceRef,
  330.                                  PCCardEventMask         eventMask,
  331.                                  PCCardEventHandler     clientCallBack,
  332.                                  void *                    clientParam,
  333.                                  PCCardClientID *        newClientID);
  334.  
  335. EXTERN_API_C( OSStatus )
  336. PCCardDeRegisterClient            (PCCardClientID         theClientID);
  337.  
  338. EXTERN_API_C( OSStatus )
  339. PCCardRegisterTimer                (PCCardClientID         registeredClientID,
  340.                                  PCCardTimerID *        lpNewTimerID,
  341.                                  long                     delay);
  342.  
  343. EXTERN_API_C( void )
  344. PCCardDeRegisterTimer            (PCCardTimerID             timerID);
  345.  
  346. EXTERN_API_C( OSStatus )
  347. PCCardSetEventMask                (PCCardClientID         theClientID,
  348.                                  PCCardEventMask         newEventMask);
  349.  
  350. EXTERN_API_C( OSStatus )
  351. PCCardGetEventMask                (PCCardClientID         theClientID,
  352.                                  PCCardEventMask *        newEventMask);
  353.  
  354. EXTERN_API_C( OSStatus )
  355. PCCardGetCardServicesInfo        (ItemCount *            socketCount,
  356.                                  UInt32 *                complianceLevel,
  357.                                  UInt32 *                version);
  358.  
  359. EXTERN_API_C( OSStatus )
  360. PCCardGetSocketRef                (PCCardSocket             vSocket,
  361.                                  RegEntryID *            socketRef);
  362.  
  363. EXTERN_API_C( OSStatus )
  364. PCCardGetCardRef                (PCCardSocket             vSocket,
  365.                                  RegEntryID *            cardRef);
  366.  
  367. EXTERN_API_C( OSStatus )
  368. PCCardGetDeviceRef                (PCCardSocket             vSocket,
  369.                                  UInt32                 device,
  370.                                  RegEntryID *            deviceRef);
  371.  
  372. EXTERN_API_C( OSStatus )
  373. PCCardGetSocketAndDeviceFromDeviceRef (const RegEntryID * deviceRef,
  374.                                  PCCardSocket *            vSocket,
  375.                                  UInt32 *                device);
  376.  
  377. EXTERN_API_C( OSStatus )
  378. PCCardGetCardRefFromDeviceRef    (const RegEntryID *        deviceRef,
  379.                                  RegEntryID *            cardRef);
  380.  
  381.  
  382. /*----------------------------------------------------------------------
  383.     Resource Management
  384. ----------------------------------------------------------------------*/
  385. EXTERN_API_C( OSStatus )
  386. PCCardRequestWindow                (const RegEntryID *        deviceRef,
  387.                                  PCCardWindowAttributes  windowAttributes,
  388.                                  LogicalAddress *        windowBase,
  389.                                  ByteCount *            windowSize,
  390.                                  PCCardAccessSpeed *    windowSpeed,
  391.                                  PCCardWindowOffset *    windowOffset,
  392.                                  PCCardWindowID *        windowID);
  393.  
  394. EXTERN_API_C( OSStatus )
  395. PCCardModifyWindow                (PCCardWindowID         windowID,
  396.                                  PCCardWindowAttributes  windowAttributes,
  397.                                  PCCardAccessSpeed         windowSpeed,
  398.                                  PCCardWindowOffset     windowOffset);
  399.  
  400. EXTERN_API_C( OSStatus )
  401. PCCardReleaseWindow                (PCCardWindowID         windowID);
  402.  
  403. EXTERN_API_C( OSStatus )
  404. PCCardInquireWindow                (const RegEntryID *        deviceRef,
  405.                                  PCCardWindowID         windowID,
  406.                                  PCCardWindowAttributes * windowAttributes,
  407.                                  LogicalAddress *        windowBase,
  408.                                  ByteCount *            windowSize,
  409.                                  PCCardAccessSpeed *    windowSpeed,
  410.                                  PCCardWindowOffset *    windowOffset);
  411.  
  412. EXTERN_API_C( OSStatus )
  413. PCCardGetStatus                    (const RegEntryID *        deviceRef,
  414.                                  UInt32 *                currentState,
  415.                                  UInt32 *                changedState,
  416.                                  PCCardVoltage *        Vcc,
  417.                                  PCCardVoltage *        Vpp);
  418.  
  419. EXTERN_API_C( OSStatus )
  420. PCCardRequestConfiguration        (const RegEntryID *        deviceRef,
  421.                                  PCCardConfigOptions     configOptions,
  422.                                  PCCardInterfaceType     ifType,
  423.                                  PCCardCustomInterfaceID  ifCustomType,
  424.                                  PCCardVoltage             vcc,
  425.                                  PCCardVoltage             vpp,
  426.                                  LogicalAddress         configRegistersBase,
  427.                                  PCCardConfigPresentMask  configRegistersPresent,
  428.                                  PCCardFunctionConfigReg * configRegisterValues);
  429.  
  430. EXTERN_API_C( OSStatus )
  431. PCCardReleaseConfiguration        (const RegEntryID *        deviceRef);
  432.  
  433. EXTERN_API_C( OSStatus )
  434. PCCardModifyConfiguration        (const RegEntryID *        deviceRef,
  435.                                  PCCardConfigOptions     configOptions,
  436.                                  PCCardVoltage             vpp);
  437.  
  438. EXTERN_API_C( OSStatus )
  439. PCCardReadConfigurationRegister    (const RegEntryID *        deviceRef,
  440.                                  PCCardConfigRegisterIndex  whichRegister,
  441.                                  PCCardConfigRegisterOffset  offset,
  442.                                  UInt8 *                value);
  443.  
  444. EXTERN_API_C( OSStatus )
  445. PCCardWriteConfigurationRegister (const RegEntryID *    deviceRef,
  446.                                  PCCardConfigRegisterIndex  whichRegister,
  447.                                  PCCardConfigRegisterOffset  offset,
  448.                                  UInt8                     value);
  449.  
  450. EXTERN_API_C( OSStatus )
  451. PCCardResetFunction                (const RegEntryID *        deviceRef);
  452.  
  453. /*----------------------------------------------------------------------
  454.     Client Utilities
  455. ----------------------------------------------------------------------*/
  456.  
  457. typedef UInt8                             PCCardTupleKind;
  458. typedef struct OpaquePCCardTupleIterator*  PCCardTupleIterator;
  459. EXTERN_API_C( PCCardTupleIterator )
  460. PCCardNewTupleIterator            (void);
  461.  
  462. EXTERN_API_C( OSStatus )
  463. PCCardDisposeTupleIterator        (PCCardTupleIterator     tupleIterator);
  464.  
  465. EXTERN_API_C( OSStatus )
  466. PCCardGetFirstTuple                (const RegEntryID *        deviceID,
  467.                                  PCCardTupleKind         desiredTuple,
  468.                                  PCCardTupleIterator     tupleIterator,
  469.                                  void *                    dataBuffer,
  470.                                  UInt32 *                dataBufferSize,
  471.                                  PCCardTupleKind *        foundTuple,
  472.                                  UInt32 *                foundTupleDataSize);
  473.  
  474. EXTERN_API_C( OSStatus )
  475. PCCardGetNextTuple                (const RegEntryID *        deviceRef,
  476.                                  PCCardTupleKind         desiredTuple,
  477.                                  PCCardTupleIterator     tupleIterator,
  478.                                  void *                    dataBuffer,
  479.                                  UInt32 *                dataBufferSize,
  480.                                  PCCardTupleKind *        foundTuple,
  481.                                  UInt32 *                foundTupleDataSize);
  482.  
  483. /*----------------------------------------------------------------------
  484.     Miscellaneous
  485. ----------------------------------------------------------------------*/
  486. EXTERN_API_C( OSStatus )
  487. PCCardEject                        (const RegEntryID *        cardRef);
  488.  
  489. EXTERN_API_C( OSStatus )
  490. PCCardEnableModemSound            (const RegEntryID *        cardRef,
  491.                                  Boolean                 enableSound);
  492.  
  493. EXTERN_API_C( OSStatus )
  494. PCCardEnableZoomedVideoSound    (const RegEntryID *        cardRef,
  495.                                  Boolean                 enableSound);
  496.  
  497. EXTERN_API_C( OSStatus )
  498. PCCardSetPowerLevel                (const RegEntryID *        deviceRef,
  499.                                  PCCardPowerOptions     powerLevel);
  500.  
  501. EXTERN_API_C( OSStatus )
  502. PCCardSetRingIndicate            (const RegEntryID *        deviceRef,
  503.                                  Boolean                 setRingIndicate);
  504.  
  505. EXTERN_API_C( OSStatus )
  506. PCCardGetGlobalOptions            (PCCardOptionSelector     selector,
  507.                                  void *                    value);
  508.  
  509. typedef UInt32                             PCCardDevType;
  510. typedef UInt32                             PCCardSubType;
  511. /* values for PCCardType and PCCardSubType*/
  512.  
  513. enum {
  514.     kPCCardUnknownType            = 0,
  515.     kPCCardMultiFunctionType    = 1,
  516.     kPCCardMemoryType            = 2,
  517.     kPCCardNullSubType            = 0,                            /* Memory sub types */
  518.     kPCCardRomSubType            = 1,
  519.     kPCCardOTPromSubType        = 2,
  520.     kPCCardEpromSubType            = 3,
  521.     kPCCardEEpromSubType        = 4,
  522.     kPCCardFlashSubType            = 5,
  523.     kPCCardSramSubType            = 6,
  524.     kPCCardDramSubType            = 7,
  525.     kPCCardSerialPortType        = 3,
  526.     kPCCardSerialOnlySubType    = 0,
  527.     kPCCardDataModemSubType        = 1,
  528.     kPCCardFaxModemSubType        = 2,
  529.     kPCCardFaxAndDataModemMask    = (kPCCardDataModemSubType | kPCCardFaxModemSubType),
  530.     kPCCardVoiceEncodingSubType    = 4,
  531.     kPCCardParallelPortType        = 4,
  532.     kPCCardFixedDiskType        = 5,
  533.     kPCCardUnknownFixedDiskType    = 0,
  534.     kPCCardATAInterfaceDiskSubType = 1,
  535.     kPCCardRotatingDeviceSubType = (0 << 7),
  536.     kPCCardSiliconDevice        = (1 << 7),
  537.     kPCCardVideoAdaptorType        = 6,
  538.     kPCCardNetworkAdaptorType    = 7,
  539.     kPCCardArcNetSubType        = 1,                            /* network sub types */
  540.     kPCCardEthernetSubType        = 2,
  541.     kPCCardTokenRingSubType        = 3,
  542.     kPCCardLocalTalkSubType        = 4,
  543.     kPCCardFDDI_CDDISubType        = 5,
  544.     kPCCardATMSubType            = 6,
  545.     kPCCardWirelessSubType        = 7,
  546.     kPCCardAIMSType                = 8,
  547.     kPCCardSCSIType                = 9,
  548.     kPCCardSerialBusType        = 10,
  549.     kPCCardUSBBusSubType        = 1,
  550.     kPCCardFirewireBusSubType    = 2
  551. };
  552.  
  553. EXTERN_API_C( OSStatus )
  554. PCCardGetCardInfo                (const RegEntryID *        cardRef,
  555.                                  PCCardDevType *        cardType,
  556.                                  PCCardSubType *        cardSubType,
  557.                                  StringPtr                 cardName,
  558.                                  StringPtr                 vendorName);
  559.  
  560.  
  561. enum {
  562.     kPCCard16HardwareType        = FOUR_CHAR_CODE('pc16'),
  563.     kCardBusHardwareType        = FOUR_CHAR_CODE('cdbs')
  564. };
  565.  
  566. typedef UInt32                             PCCardHardwareType;
  567. EXTERN_API_C( OSStatus )
  568. PCCardGetCardType                (const RegEntryID *        socketRef,
  569.                                  PCCardHardwareType *    cardType);
  570.  
  571. /* error codes */
  572.  
  573. enum {
  574.     kBadAdapterErr                = -9050,                        /* invalid adapter number*/
  575.     kBadAttributeErr            = -9051,                        /* specified attributes field value is invalid*/
  576.     kBadBaseErr                    = -9052,                        /* specified base system memory address is invalid*/
  577.     kBadEDCErr                    = -9053,                        /* specified EDC generator specified is invalid*/
  578.     kBadIRQErr                    = -9054,                        /* specified IRQ level is invalid*/
  579.     kBadOffsetErr                = -9055,                        /* specified PC card memory array offset is invalid*/
  580.     kBadPageErr                    = -9056,                        /* specified page is invalid*/
  581.     kBadSizeErr                    = -9057,                        /* specified size is invalid*/
  582.     kBadSocketErr                = -9058,                        /* specified logical or physical socket number is invalid*/
  583.     kBadTypeErr                    = -9059,                        /* specified window or interface type is invalid*/
  584.     kBadVccErr                    = -9060,                        /* specified Vcc power level index is invalid*/
  585.     kBadVppErr                    = -9061,                        /* specified Vpp1 or Vpp2 power level index is invalid*/
  586.     kBadWindowErr                = -9062,                        /* specified window is invalid*/
  587.     kBadArgLengthErr            = -9063,                        /* ArgLength argument is invalid*/
  588.     kBadArgsErr                    = -9064,                        /* values in argument packet are invalid*/
  589.     kBadHandleErr                = -9065,                        /* clientHandle is invalid*/
  590.     kBadCISErr                    = -9066,                        /* CIS on card is invalid*/
  591.     kBadSpeedErr                = -9067,                        /* specified speed is unavailable*/
  592.     kReadFailureErr                = -9068,                        /* unable to complete read request*/
  593.     kWriteFailureErr            = -9069,                        /* unable to complete write request*/
  594.     kGeneralFailureErr            = -9070,                        /* an undefined error has occurred*/
  595.     kNoCardErr                    = -9071,                        /* no PC card in the socket*/
  596.     kUnsupportedFunctionErr        = -9072,                        /* function is not supported by this implementation*/
  597.     kUnsupportedModeErr            = -9073,                        /* mode is not supported*/
  598.     kBusyErr                    = -9074,                        /* unable to process request at this time - try later*/
  599.     kWriteProtectedErr            = -9075,                        /* media is write-protected*/
  600.     kConfigurationLockedErr        = -9076,                        /* a configuration has already been locked*/
  601.     kInUseErr                    = -9077,                        /* requested resource is being used by a client*/
  602.     kNoMoreItemsErr                = -9078,                        /* there are no more of the requested item*/
  603.     kOutOfResourceErr            = -9079,                        /* Card Services has exhausted the resource*/
  604.     kNoCardSevicesSocketsErr    = -9080,
  605.     kInvalidRegEntryErr            = -9081,
  606.     kBadLinkErr                    = -9082,
  607.     kBadDeviceErr                = -9083,
  608.     k16BitCardErr                = -9084,
  609.     kCardBusCardErr                = -9085,
  610.     kPassCallToChainErr            = -9086,
  611.     kCantConfigureCardErr        = -9087,
  612.     kPostCardEventErr            = -9088,                        /* _PCCSLPostCardEvent failed and dropped an event */
  613.     kInvalidDeviceNumber        = -9089,
  614.     kUnsupportedVsErr            = -9090,                        /* Unsupported Voltage Sense */
  615.     kInvalidCSClientErr            = -9091,                        /* Card Services ClientID is not registered */
  616.     kBadTupleDataErr            = -9092,                        /* Data in tuple is invalid */
  617.     kBadCustomIFIDErr            = -9093,                        /* Custom interface ID is invalid */
  618.     kNoIOWindowRequestedErr        = -9094,                        /* Request I/O window before calling configuration */
  619.     kNoMoreTimerClientsErr        = -9095,                        /* All timer callbacks are in use */
  620.     kNoMoreInterruptSlotsErr    = -9096,                        /* All internal Interrupt slots are in use */
  621.     kNoClientTableErr            = -9097,                        /* The client table has not be initialized yet */
  622.     kUnsupportedCardErr            = -9098,                        /* Card not supported by generic enabler*/
  623.     kNoCardEnablersFoundErr        = -9099,                        /* No Enablers were found*/
  624.     kNoEnablerForCardErr        = -9100,                        /* No Enablers were found that can support the card*/
  625.     kNoCompatibleNameErr        = -9101,                        /* There is no compatible driver name for this device*/
  626.     kClientRequestDenied        = -9102,                        /* CS Clients should return this code inorder to */
  627.                                                                 /*   deny a request-type CS Event                */
  628.     kNotReadyErr                = -9103,                        /* PC Card failed to go ready */
  629.     kTooManyIOWindowsErr        = -9104,                        /* device requested more than one I/O window */
  630.     kAlreadySavedStateErr        = -9105,                        /* The state has been saved on previous call */
  631.     kAttemptDupCardEntryErr        = -9106,                        /* The Enabler was asked to create a duplicate card entry */
  632.     kCardPowerOffErr            = -9107,                        /* Power to the card has been turned off */
  633.     kNotZVCapableErr            = -9108,                        /* This socket does not support Zoomed Video */
  634.     kNoCardBusCISErr            = -9109                            /* No valid CIS exists for this CardBus card */
  635. };
  636.  
  637.  
  638. #if PRAGMA_STRUCT_ALIGN
  639.     #pragma options align=reset
  640. #elif PRAGMA_STRUCT_PACKPUSH
  641.     #pragma pack(pop)
  642. #elif PRAGMA_STRUCT_PACK
  643.     #pragma pack()
  644. #endif
  645.  
  646. #ifdef PRAGMA_IMPORT_OFF
  647. #pragma import off
  648. #elif PRAGMA_IMPORT
  649. #pragma import reset
  650. #endif
  651.  
  652. #ifdef __cplusplus
  653. }
  654. #endif
  655.  
  656. #endif /* __PCCARD__ */
  657.  
  658.